#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    , m_ptcpsocket(new QTcpSocket(this))
{
    ui->setupUi(this);

    init_network();

    connect(ui->pushButton, &QPushButton::clicked, this, &Widget::disconnectbtn_clicked);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::init_network(){
    m_ptcpsocket->connectToHost("127.0.0.1", 8099);

    return;
}

void Widget::disconnectbtn_clicked(){
    m_ptcpsocket->close();

    return;
}

